home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form FrmProperty
- BorderStyle = 3 'Fixed Dialog
- Caption = "Service property"
- ClientHeight = 6540
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 7350
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 6540
- ScaleWidth = 7350
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 'CenterOwner
- Begin VB.CommandButton btnChange
- Caption = "Change"
- Height = 375
- Left = 6000
- TabIndex = 36
- Top = 6060
- Width = 1275
- End
- Begin VB.CommandButton btnCancel
- Caption = "Cancel"
- Height = 375
- Left = 4620
- TabIndex = 35
- Top = 6060
- Width = 1275
- End
- Begin VB.Frame Frame3
- Caption = "Service type"
- Height = 855
- Left = 60
- TabIndex = 27
- Top = 5040
- Width = 7215
- Begin VB.CheckBox cbxRecognizer
- Caption = "Recognizer driver"
- Height = 195
- Left = 5460
- TabIndex = 34
- Top = 240
- Width = 1695
- End
- Begin VB.CheckBox cbxInteractive
- Caption = "Interactive process"
- Height = 195
- Left = 3960
- TabIndex = 33
- Top = 540
- Width = 1695
- End
- Begin VB.CheckBox cbxAdapter
- Caption = "Adapter"
- Height = 195
- Left = 3960
- TabIndex = 32
- Top = 240
- Width = 1695
- End
- Begin VB.CheckBox cbxWin32Shared
- Caption = "win32 shared process"
- Height = 195
- Left = 1980
- TabIndex = 31
- Top = 540
- Width = 1935
- End
- Begin VB.CheckBox cbxFileDriver
- Caption = "File system driver"
- Height = 195
- Left = 1980
- TabIndex = 30
- Top = 240
- Width = 1695
- End
- Begin VB.CheckBox cbxWin32Own
- Caption = "Win32 own process"
- Height = 195
- Left = 120
- TabIndex = 29
- Top = 540
- Width = 1755
- End
- Begin VB.CheckBox cbxKernelDriver
- Caption = "Kernel driver"
- Height = 195
- Left = 120
- TabIndex = 28
- Top = 240
- Width = 1455
- End
- End
- Begin VB.Frame Frame2
- Caption = "Error control"
- Height = 675
- Left = 60
- TabIndex = 22
- Top = 4320
- Width = 7215
- Begin VB.OptionButton rbnIgnore
- Caption = "Ignore"
- Height = 195
- Left = 180
- TabIndex = 26
- Top = 300
- Width = 1155
- End
- Begin VB.OptionButton rbnNormal
- Caption = "Normal"
- Height = 195
- Left = 1380
- TabIndex = 25
- Top = 300
- Width = 1155
- End
- Begin VB.OptionButton rbnSevere
- Caption = "Severe"
- Height = 195
- Left = 2940
- TabIndex = 24
- Top = 300
- Width = 1155
- End
- Begin VB.OptionButton rbnCritical
- Caption = "Critical"
- Height = 195
- Left = 4440
- TabIndex = 23
- Top = 300
- Width = 1155
- End
- End
- Begin VB.Frame Frame1
- Caption = "Startup"
- Height = 675
- Left = 60
- TabIndex = 16
- Top = 3600
- Width = 7215
- Begin VB.OptionButton rbnDisabled
- Caption = "Disabled"
- Height = 195
- Left = 5820
- TabIndex = 21
- Top = 300
- Width = 1155
- End
- Begin VB.OptionButton rbnManual
- Caption = "Manual"
- Height = 195
- Left = 4440
- TabIndex = 20
- Top = 300
- Width = 1155
- End
- Begin VB.OptionButton rbnAutomatic
- Caption = "Automatic"
- Height = 195
- Left = 2940
- TabIndex = 19
- Top = 300
- Width = 1155
- End
- Begin VB.OptionButton rbnSystemStart
- Caption = "SystemStart"
- Height = 195
- Left = 1380
- TabIndex = 18
- Top = 300
- Width = 1155
- End
- Begin VB.OptionButton rbnBoot
- Caption = "Boot"
- Height = 195
- Left = 180
- TabIndex = 17
- Top = 300
- Width = 1155
- End
- End
- Begin VB.TextBox edtPassword
- Height = 345
- Left = 1800
- TabIndex = 14
- Top = 3120
- Width = 2175
- End
- Begin VB.TextBox edtAccount
- Height = 345
- Left = 1800
- TabIndex = 12
- Top = 2700
- Width = 2175
- End
- Begin VB.TextBox edtOrderWithinGroup
- BackColor = &H8000000F&
- Enabled = 0 'False
- Height = 345
- Left = 1800
- TabIndex = 10
- Top = 2160
- Width = 2175
- End
- Begin VB.ComboBox cmbLoadOrder
- Height = 315
- Left = 1800
- TabIndex = 9
- Top = 1740
- Width = 2175
- End
- Begin VB.TextBox memDependencies
- Height = 1755
- Left = 4200
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 7
- Top = 1740
- Width = 3075
- End
- Begin VB.TextBox EdtBinaryFile
- Height = 345
- Left = 1800
- TabIndex = 5
- Top = 960
- Width = 5475
- End
- Begin VB.TextBox EdtDisplayName
- Height = 345
- Left = 1800
- TabIndex = 3
- Top = 540
- Width = 5475
- End
- Begin VB.TextBox edtServiceName
- BackColor = &H8000000F&
- Enabled = 0 'False
- Height = 345
- Left = 1800
- TabIndex = 1
- Top = 120
- Width = 5475
- End
- Begin VB.Label Label8
- Caption = "Password"
- Height = 255
- Left = 120
- TabIndex = 15
- Top = 3180
- Width = 1395
- End
- Begin VB.Label Label7
- Caption = "Account to start under"
- Height = 255
- Left = 120
- TabIndex = 13
- Top = 2760
- Width = 1635
- End
- Begin VB.Label Label6
- Caption = "Order within group"
- Height = 255
- Left = 120
- TabIndex = 11
- Top = 2220
- Width = 1455
- End
- Begin VB.Label Label5
- Caption = "Load order group"
- Height = 255
- Left = 120
- TabIndex = 8
- Top = 1800
- Width = 1455
- End
- Begin VB.Label Label4
- Caption = "Dependencies"
- Height = 255
- Left = 4200
- TabIndex = 6
- Top = 1440
- Width = 1695
- End
- Begin VB.Label Label3
- Caption = "Binary file name"
- Height = 255
- Left = 120
- TabIndex = 4
- Top = 1020
- Width = 1155
- End
- Begin VB.Label Label2
- Caption = "Displayed name"
- Height = 255
- Left = 120
- TabIndex = 2
- Top = 600
- Width = 1155
- End
- Begin VB.Label Label1
- Caption = "Sevice name"
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 180
- Width = 1155
- End
- Attribute VB_Name = "FrmProperty"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub btnCancel_Click()
- Unload FrmProperty
- End Sub
- Private Sub btnChange_Click()
- On Error GoTo ErrorHandler
- If MsgBox("Are you sure to change service properties?. It may cause system damage !", vbExclamation + vbOKCancel) = vbOK Then
- Set NTServiceX = FrmServiceManager.NTServiceX
- NTServiceX.ManagerAccess = M_CONNECT + M_MODIFY_BOOT_CONFIG
- NTServiceX.ServiceAccess = S_ALL_ACCESS
- NTServiceX.ActiveManager = True
- NTServiceX.ActiveService = True
- AServiceType = 0
- If cbxKernelDriver.Value = Checked Then AServiceType = AServiceType + KERNEL_DRIVER
- If cbxFileDriver.Value = Checked Then AServiceType = AServiceType + FILE_SYSTEM_DRIVER
- If cbxAdapter.Value = Checked Then AServiceType = AServiceType + ADAPTER
- If cbxRecognizer.Value = Checked Then AServiceType = AServiceType + RECOGNIZER_DRIVER
- If cbxWin32Own.Value = Checked Then AServiceType = AServiceType + WIN32_OWN_PROCESS
- If cbxWin32Shared.Value = Checked Then AServiceType = AServiceType + WIN32_SHARE_PROCESS
- If cbxInteractive.Value = Checked Then AServiceType = AServiceType + INTERACTIVE_PROCESS
- NTServiceX.ServiceType = AServiceType
- If rbnBoot.Value Then NTServiceX.StartType = BOOT_START Else
- If rbnSystemStart.Value Then NTServiceX.StartType = SYSTEM_START Else
- If rbnAutomatic.Value Then NTServiceX.StartType = AUTO_START Else
- If rbnManual.Value Then NTServiceX.StartType = DEMAND_START Else
- If rbnDisabled.Value Then NTServiceX.StartType = DISABLED
-
- If rbnIgnore.Value Then NTServiceX.ErrorControl = ERROR_IGNORE Else
- If rbnNormal.Value Then NTServiceX.ErrorControl = ERROR_NORMAL Else
- If rbnSevere.Value Then NTServiceX.ErrorControl = ERROR_SEVERE Else
- If rbnCritical.Value Then NTServiceX.ErrorControl = ERROR_CRITICAL
- NTServiceX.BinaryPathName = EdtBinaryFile.Text
- NTServiceX.DisplayName = EdtDisplayName.Text
- NTServiceX.LoadOrder = cmbLoadOrder.Text
- NTServiceX.Dependencies.Text = memDependencies.Text
- If (edtAccount.Tag > 0) Or (edtPassword.Tag > 0) Then
- NTServiceX.Password = edtPassword.Text
- NTServiceX.ServiceStartName = edtAccount.Text
- End If
-
- ExitProc:
- NTServiceX.ActiveService = False
- NTServiceX.ActiveManager = False
- FrmServiceManager.Sleep (2)
- End If
- Unload FrmProperty
- Exit Sub
- ErrorHandler:
- MsgBox (Err.Description)
- Resume ExitProc
- End Sub
- Private Sub edtAccount_Change()
- edtAccount.Tag = 1
- End Sub
- Private Sub edtPassword_Change()
- edtPassword.Tag = 1
- End Sub
- Private Sub Form_Load()
- On Error GoTo ErrorHandler
- btnChange.Enabled = Not (FrmServiceManager.cbxReadOnly.Value = 1)
- Set Item = FrmServiceManager.List.Items(FrmServiceManager.lbxServices.ListIndex)
- Set NTServiceX = FrmServiceManager.NTServiceX
- edtServiceName.Text = Item.ServiceName
- NTServiceX.ServiceName = edtServiceName.Text
- NTServiceX.ManagerAccess = M_CONNECT
- NTServiceX.ServiceAccess = S_QUERY_CONFIG
- NTServiceX.ActiveManager = True
- NTServiceX.ActiveService = True
- EdtDisplayName.Text = NTServiceX.DisplayName
- EdtBinaryFile.Text = NTServiceX.BinaryPathName
- cmbLoadOrder.Text = NTServiceX.LoadOrder
- edtOrderWithinGroup.Text = Format(NTServiceX.TagId, "0")
- memDependencies.Text = NTServiceX.Dependencies.Text
- edtAccount.Text = NTServiceX.ServiceStartName
- edtPassword.Text = "****************"
- edtAccount.Tag = 0
- edtPassword.Tag = 0
- If NTServiceX.StartType = BOOT_START Then rbnBoot.Value = True Else
- If NTServiceX.StartType = SYSTEM_START Then rbnSystemStart.Value = True Else
- If NTServiceX.StartType = AUTO_START Then rbnAutomatic.Value = True Else
- If NTServiceX.StartType = DEMAND_START Then rbnManual.Value = True Else
- If NTServiceX.StartType = DISABLED Then rbnDisabled.Value = True
- If NTServiceX.ErrorControl = ERROR_IGNORE Then rbnIgnore.Value = True Else
- If NTServiceX.ErrorControl = ERROR_NORMAL Then rbnNormal.Value = True Else
- If NTServiceX.ErrorControl = ERROR_SEVERE Then rbnSevere.Value = True Else
- If NTServiceX.ErrorControl = ERROR_CRITICAL Then rbnCritical.Value = True
- If (KERNEL_DRIVER And NTServiceX.ServiceType) > 0 Then cbxKernelDriver.Value = Checked
- If (FILE_SYSTEM_DRIVER And NTServiceX.ServiceType) > 0 Then cbxFileDriver.Value = Checked
- If (ADAPTER And NTServiceX.ServiceType) > 0 Then cbxAdapter.Value = Checked
- If (RECOGNIZER_DRIVER And NTServiceX.ServiceType) > 0 Then cbxRecognizer.Value = Checked
- If (WIN32_OWN_PROCESS And NTServiceX.ServiceType) > 0 Then cbxWin32Own.Value = Checked
- If (WIN32_SHARE_PROCESS And NTServiceX.ServiceType) > 0 Then cbxWin32Shared.Value = Checked
- If (INTERACTIVE_PROCESS And NTServiceX.ServiceType) > 0 Then cbxInteractive.Value = Checked
- Set AList = NTServiceX.GetOrderGroupList
- For i = 0 To AList.Count - 1
- cmbLoadOrder.AddItem (AList.Item(i))
- Next i
- ExitProc:
- NTServiceX.ActiveService = False
- NTServiceX.ActiveManager = False
- Exit Sub
- ErrorHandler:
- MsgBox (Err.Description)
- Resume ExitProc
- End Sub
-